package com.cust.cow.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cust.cow.common.Result;
import com.cust.cow.pojo.matingLog;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@Mapper
public interface MatingLogMapper extends BaseMapper<matingLog> {

    @Select("select * from matingLog")
    public List<matingLog> findMatingLogAll();

    @Insert("insert into matingLog values(#{cattleId}, #{matingDate}, #{state})")
    public int insertMatingLog(@RequestBody matingLog matingLog);

    @Delete("delete from matingLog where cattl_id = #{cattleId}")
    public int deleteMatingLog(Integer cattleId);

}
